package cn.zmx.ipregion;

import org.dom4j.DocumentException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.concurrent.locks.ReentrantLock;

@Controller
@CrossOrigin
public class IpRegionController {

    @Autowired
    private IpRegionQueryImpl ipRegionQuery;

    @RequestMapping(value = "/find",method = RequestMethod.GET)
    @ResponseBody
    @CrossOrigin
    public IpRegion find(@RequestParam("ip")String ip){
        return ipRegionQuery.findIp(ip);
    }
}
